#tag Class
Protected Class controlButtonPict
Inherits Picture
	#tag Method, Flags = &h0
		Sub create(caption as string, fontsize as integer, active as boolean)
		  dim W,H,i as Integer
		  dim g as Graphics
		  dim col1,col2,col3 as color
		  
		  if active then
		    col1=altBaseColor
		    col2=shadeColor
		    col3=textColor
		  else
		    col1=baseColor
		    col2=shadeColor
		    col3=textColor
		  end
		  
		  W=me.Width
		  H=me.Height
		  
		  pic=new Picture(W,H,32)
		  g=pic.Graphics
		  
		  //draw background on baseColor
		  
		  g.forecolor= col1
		  g.FillRect(2,2, W-4, H-4)
		  
		  //fill in the shade
		  
		  for i=20 downto 1
		    g.forecolor=RGB(baseColor.Red+((20-i)*10),baseColor.Green+((20-i)*10),baseColor.Blue+((20-i)*10))
		    g.DrawLine 2,i,W-4,i
		  next
		  
		  g.forecolor= col3
		  g.TextSize=fontsize
		  
		  g.drawstring caption, W/2-g.StringWidth(caption)/2,H-(H/4)
		  
		  if pic<>nil then
		    Graphics.DrawPicture pic,0,0
		  end
		End Sub
	#tag EndMethod


	#tag Property, Flags = &h0
		pic As Picture
	#tag EndProperty


	#tag Constant, Name = altBaseColor, Type = Color, Dynamic = False, Default = \"&c000000", Scope = Public
	#tag EndConstant

	#tag Constant, Name = baseColor, Type = Color, Dynamic = False, Default = \"&c3B3B3B", Scope = Public
	#tag EndConstant

	#tag Constant, Name = shadeColor, Type = Color, Dynamic = False, Default = \"&c575757", Scope = Public
	#tag EndConstant

	#tag Constant, Name = textColor, Type = Color, Dynamic = False, Default = \"&cCCCCCC", Scope = Public
	#tag EndConstant


	#tag ViewBehavior
		#tag ViewProperty
			Name="Depth"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
			InheritedFrom="Picture"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Height"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
			InheritedFrom="Picture"
		#tag EndViewProperty
		#tag ViewProperty
			Name="HorizontalResolution"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
			InheritedFrom="Picture"
		#tag EndViewProperty
		#tag ViewProperty
			Name="ImageCount"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
			InheritedFrom="Picture"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Index"
			Visible=true
			Group="ID"
			InitialValue="-2147483648"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Left"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Name"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="pic"
			Group="Behavior"
			InitialValue="0"
			Type="Picture"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Super"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Top"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Transparent"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
			InheritedFrom="Picture"
		#tag EndViewProperty
		#tag ViewProperty
			Name="VerticalResolution"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
			InheritedFrom="Picture"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Width"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
			InheritedFrom="Picture"
		#tag EndViewProperty
	#tag EndViewBehavior
End Class
#tag EndClass
